$(()=>{
   // 获取路由
   let index = location.href.indexOf('?');
   let routerName = '';
   // 先判断?后面是否有参数
   if(index == -1){//没有参数
      routerName = location.href.substr(location.href.lastIndexOf('/')+1);
   }else{
      routerName = location.href.substring(location.href.lastIndexOf('/')+1,location.href.indexOf('?'));
   }

   // 判断
   if( routerName == 'posts' || routerName == 'post-add' || routerName == 'categories'){
      // 实现展开
      $('#menu-posts').addClass('in').attr('aria-expanded',true);
      $('#menu-posts').parent().find('.collapsed').removeClass('collapsed').attr('aria-expanded',true);
   }
   // 判断
   if( routerName == 'nav-menus' || routerName == 'slides' || routerName == 'settings'){
      $('#menu-settings').addClass('in').attr('aria-expanded',true);
      $('#menu-settings').parent().find('.collapsed').removeClass('collapsed').attr('aria-expanded',true);
   }
})